<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="approvedClassId" value="#{approvedClassHome.id}"></f:viewParam>
	   	<f:event listener="#{approvedClassHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="考核分类管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="#{approvedClassHome.managed ? '修改' : '新增'}考核分类" style="margin-bottom:10px;">
		        <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        
		        <h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel for="className" value="分类名称" />				
					<p:inputText id="className" 
							  value="#{approvedClassHome.instance.name}"
						   required="true" />
						   
				    <p:outputLabel for="approvedType" value="日常考评/违规处罚" />				
					<p:selectOneMenu id="approvedType" 
							  value="#{approvedClassHome.instance.approvedType}"
						   required="true">
						<f:selectItem itemLabel="请选择" itemValue="#{null}"/>
						<f:selectItems value="#{enumUtils.getEnumArray('approved.ApprovedType')}" var="_type" itemLabel="#{_type.typeName}" itemValue="#{_type}"></f:selectItems>
					</p:selectOneMenu>
					
					<p:outputLabel for="sumScore" value="总分" />				
					<p:inputText id="sumScore" 
							  value="#{approvedClassHome.instance.sumScore}"
						   required="true" />
				</h:panelGrid>
			</p:panel>
			
			<p:commandButton action="#{approvedClassHome.saveAndFlush()}" value="保存" ajax="false" />
			<p:commandButton value="删除" action="#{approvedClassHome.delete()}">
				<p:confirm header="请确认" message="您确认删除记录吗?" icon="ui-icon-alert" />
			</p:commandButton>
			<p:commandButton action="#{approvedClassHome.cancel()}" value="取消" immediate="true"></p:commandButton>	
						
			<p:confirmDialog id="confirmDialog" global="true" showEffect="fade" hideEffect="explode" widgetVar="confirmDialog">
			    <p:commandButton value="确认" styleClass="ui-confirmdialog-yes"></p:commandButton>
			    <p:commandButton value="取消" immediate="true" styleClass="ui-confirmdialog-no" />
			</p:confirmDialog>
		</h:form>
      
   	</ui:define>
</ui:composition>
